﻿using System;
using System.Windows.Data;

namespace Apps.Yunwei.Converters
{
    public class TypeToCheckedConverter : IValueConverter
	{
        public object Convert(object value, Type targetType, object parameter
            , System.Globalization.CultureInfo culture)
        {
            if (value == null)
                return false;
            return (value.ToString().Equals("1"));
        }
        public object ConvertBack(object value, Type targetType, object parameter
            , System.Globalization.CultureInfo culture)
        {
                return value==null?string.Empty:(bool)value?"1":"0";
        }
    }
}
